package org.hcyspartnoc.demo.utils;

import io.netty.handler.ssl.ClientAuth;
import io.netty.handler.ssl.SslContext;
import io.netty.handler.ssl.SslContextBuilder;

import java.io.File;

/**
 * @author tq
 * @version V1.0
 * @Package com.iptv.rtc.server.netty
 * @date 2021-04-01 15:49
 * @Copyright © 2018-2019 *******
 */
public class SslUtil {

    private static final File keyFile = new File("src/main/resources/safe/privkey.key");
    private static final File rootFile = new File("src/main/resources/safe/fullchain.crt");

    public static SslContext createSSLContext() throws Exception {
        SslContext sslCtx = SslContextBuilder.forServer(rootFile, keyFile).clientAuth(ClientAuth.NONE).build();
        return sslCtx;
    }
}
